package com.xizimall.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.xizimall.pojo.TbItemParam;
import com.xizimall.service.ItemParamService;
import com.xizimall.common.pojo.XizimallResult;

/**
 * 商品规格模板管理C
 * <p>Title: ItemparamController</p>
 * <p>Description: </p>
 * <p>华南理工大学研究生</p> 
 * @author	李隆熹
 * @date	2018年4月16日下午8:45:41
 * @version 1.0
 */
@Controller
@RequestMapping("/item/param")
public class ItemparamController {
  @Autowired
  private ItemParamService itemParamService;
  @RequestMapping("/query/itemcatid/{itemCatId}")
  @ResponseBody
  public XizimallResult getItemParamByCid(@PathVariable long itemCatId){
	 
	  XizimallResult result=itemParamService.getItemParamByCid(itemCatId);
	  return result;
  }
  @RequestMapping("/save/{cid}")
  @ResponseBody
  public XizimallResult insertItemParam(@PathVariable Long cid,String paramData){
	  TbItemParam itemParam=new TbItemParam();
	  itemParam.setItemCatId(cid);
	  itemParam.setParamData(paramData);
	  XizimallResult result=itemParamService.insertItemParam(itemParam);
	  return result;
	  
  }
}
